﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WLWZGao6.APItitlion.IService;
using WLWZGao6.Domain.Common;
using WLWZGao6.Domain.Model;
using WLWZGao6.Domain.Dto;
using System.Collections.Generic;
namespace WLWZGao6.APIHost.Controllers
{
    /// <summary>
    /// 用户角色控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class UserRoleController : ControllerBase
    {
        /// <summary>
        /// 角色服务接口
        /// </summary>
        public IRoleService _roleService;
        /// <summary>
        /// 用户服务接口
        /// </summary>
        public IUserService _userService;
        /// <summary>
        /// 接口实现
        /// </summary>
        /// <param name="userService"></param>
        /// <param name="roleService"></param>
        public UserRoleController(IUserService userService, IRoleService roleService)
        {
            _userService = userService;
            _roleService = roleService;
        }
        /// <summary>
        /// 用户添加角色
        /// </summary>
        /// <param name="Ids"></param>
        /// <param name="roleId"></param>
        /// <returns></returns>
        [HttpPost]
        public EData UserRoleAdd(int Ids, string roleId)
        {
            return _userService.UserRoleAdd(Ids, roleId);
        }
        
        /// <summary>
        /// 用户角色删除
        /// </summary>
        /// <param name="Ids"></param>
        /// <returns></returns>
        [HttpPost]
        public EData UserRoleDel(int Ids)
        {
            return _roleService.UserRoleDel(Ids);
        }
    }
}
